//
//  lock_btn.m
//  ICE_Player
//
//  Created by xl on 11-7-10.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "lock_btn.h"
#import "ICE_global_var.h"

@implementation lock_btn

@synthesize state;


- (void)Set_Btn_Image:(E_LOCK_BTN_IMAGE)type
{
    switch (type)
    {
        case E_LBI_LOCK:
            [self setImage:[UIImage imageNamed:@RESOURCE_PATH_LOCK] forState:UIControlStateNormal];
            break;
        case E_LBI_UNLOCK:
            [self setImage:[UIImage imageNamed:@RESOURCE_PATH_UNLOCK] forState:UIControlStateNormal];
            break;
        default:
            break;
    }
    state = type;
}

- (id)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code.
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code.
}
*/

- (void)dealloc {
	[self destroy_SubViews];
    [super dealloc];
}

- (void)create_SubViews:(UIViewController*)controller
{
    [super create_SubViews:controller];
}

- (void)destroy_SubViews
{
}

- (void)setState:(E_LOCK_BTN_IMAGE)st
{
    if (state != st)
    {
        [self Set_Btn_Image:st];
    }
}

@end
